import request from '@/utils/request'

// 查询用户所有稿件
export function getManuscript (data) {
  return request({
    url: 'manuscript/getManuscript',
    method: 'post',
    data: data
  })
}

// 提交文章
export function commitManiscript (data) {
  return request({
    url: 'user/commitManuscript',
    method: 'post',
    data: data
  })
}

// 回复修改
export function replyModification (data) {
  return request({
    url: 'user/replyModification',
    method: 'post',
    data: data
  })
}

// 条件查询稿件
export function getManiscriptByCondition (data) {
  return request({
    url: 'manuscript/get',
    method: 'post',
    data: data
  })
}

// 每个审稿人被分配的稿件
export function getManuscriptByReaderId (data) {
  return request({
    url: 'manuscript/getManuscriptByReaderId',
    method: 'post',
    data: data
  })
}

// 修改文章状态
export function updateManuscriptStatus (data) {
  return request({
    url: 'manuscript/updateManuscriptStatus',
    method: 'post',
    data: data
  })
}

// 提交审稿意见
export function commitSuggestions (data) {
  return request({
    url: 'manuscript/commitSuggestions',
    method: 'post',
    data: data
  })
}

// 录用或拒绝
export function hireOrRejectManuscript (data) {
  return request({
    url: 'manuscript/hireOrRejectManuscript',
    method: 'post',
    data: data
  })
}

// 将文章送给指定审稿人，邮件+投稿器中操作
export function sendManuscriptToReader (data) {
  return request({
    url: 'manuscript/sendManuscriptToReader',
    method: 'post',
    data: data
  })
}

// 根据稿件id 查询稿件详情
export function searchManuscriptById (id, data) {
  return request({
    url: `/manuscript/getManuscript/${id}`,
    method: 'get',
    params: data
  })
}
